﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OracleMVC.Models;
using Oracle.DataAccess.Client;
using System.Data;

namespace OracleMVC.Controllers
{
    public class FJTestController : Controller
    {
        //
        // GET: /FJTest/

        public ActionResult Index()
        {
            OracleConnection conn = new OracleConnection("User Id=system;Password=Pass01!;Data Source=orcl;");
            OracleCommand cmd;
            OracleDataAdapter da;
            OracleCommandBuilder cb;
            DataSet ds;

            conn.Open();
            string sql = "select * from SiteBranch where ID < 60";
            cmd = new OracleCommand(sql, conn);
            cmd.CommandType = CommandType.Text;
            da = new OracleDataAdapter(cmd);
            cb = new OracleCommandBuilder(da);
            ds = new DataSet();
            da.Fill(ds);
            using (FJEntities fj = new FJEntities())
            {
                return View(fj.SITEBRANCHes.FirstOrDefault());
            }
        }

    }
}
